Skip to content

Migrate build infrastructure from Gradle to Maven#2613

Open
ramsessanchez wants to merge 1 commit into
mainfrom
ramsessanchez/gradle-to-maven-migration
Open

Migrate build infrastructure from Gradle to Maven#2613
ramsessanchez wants to merge 1 commit into
mainfrom
ramsessanchez/gradle-to-maven-migration

Conversation

@ramsessanchez

Copy link
Copy Markdown
Contributor

Summary

Migrates the build system from Gradle to Maven while preserving all build behaviors.

Changes

New Maven build:

  • \pom.xml\ with all dependencies, compiler settings (Java 1.8, -parameters), jar manifest (\Automatic-Module-Name), javadoc, source, and GPG signing profile
  • Maven wrapper (\mvnw/\mvnw.cmd) replacing Gradle wrapper

CI/CD pipeline updates:

  • \gradle-build.yml\ → \maven-build.yml\ with Maven commands, cache, and artifact paths
  • \codeql-analysis.yml\ updated to use \mvnw compile\
  • ADO \ci-build.yml\ updated with Maven install/deploy and \settings.xml\ auth for ADO feed + GPG signing
  • ADO \daily-ci-build.yml\ updated with \Maven@4\ task and network-isolated mirror config

Config updates:

  • \dependabot.yml: \maven\ ecosystem for root, \gradle\ kept for /android\
  • .gitignore: swapped Gradle entries for Maven

  • elease-please-config.json: XML xpath updater for \pom.xml\ version

Android sub-project:

  • Kept as standalone Gradle project (AGP has no Maven equivalent)
  • Dependencies inlined into \�ndroid/build.gradle\ (shared \gradle/dependencies.gradle\ removed)

Removed:

  • All root Gradle files (\�uild.gradle, \settings.gradle, \gradle.properties, \gradlew, wrapper)
  • \java-8/\ sub-project (Java 8 compat now verified via Maven \source/target 1.8\ + JDK 8 CI job)

Verification

  • \mvnw compile\ — 15,185 source files compiled successfully ✅
  • \mvnw package\ — JAR (56MB), javadoc JAR (69MB), sources JAR (28MB) built ✅
  • JAR manifest contains \Automatic-Module-Name: com.microsoft.graph\ ✅

@ramsessanchez ramsessanchez requested a review from a team as a code owner June 8, 2026 22:07
@ramsessanchez ramsessanchez force-pushed the ramsessanchez/gradle-to-maven-migration branch 2 times, most recently from 89d1a9e to 8a28eb6 Compare June 8, 2026 22:19
- Add pom.xml with all dependencies, compiler settings (Java 1.8, -parameters),
  jar manifest (Automatic-Module-Name), javadoc, source, and GPG signing profile
- Add Maven wrapper (mvnw/mvnw.cmd) replacing Gradle wrapper
- Rename gradle-build.yml to maven-build.yml with Maven commands and cache
- Update codeql-analysis.yml to use mvnw compile
- Update ADO ci-build.yml with Maven install/deploy and settings.xml auth
- Update ADO daily-ci-build.yml with Maven@4 task and network-isolated mirror
- Update dependabot.yml: maven ecosystem for root, gradle kept for /android
- Update .gitignore: swap Gradle entries for Maven
- Update release-please-config.json: XML xpath updater for pom.xml version
- Inline dependencies into android/build.gradle (remove shared gradle/dependencies.gradle)
- Remove all root Gradle files and java-8/ sub-project

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ramsessanchez ramsessanchez force-pushed the ramsessanchez/gradle-to-maven-migration branch from 8a28eb6 to 4573ad2 Compare June 8, 2026 22:23
@ramsessanchez ramsessanchez requested review from baywet and Copilot June 8, 2026 23:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the repository’s root build and CI/CD from Gradle to Maven (via pom.xml + Maven Wrapper), while keeping the Android subproject on Gradle and removing the legacy java-8/ Gradle build.

Changes:

  • Introduces a root pom.xml (Java 8 source/target, -parameters, sources/javadoc jars, signing profile) and adds Maven Wrapper scripts/config.
  • Updates GitHub Actions + Azure Pipelines workflows to run Maven (./mvnw …) and adjusts artifact/test-result paths.
  • Removes root Gradle build infrastructure (including the java-8/ subproject) and inlines shared dependencies into android/build.gradle.

Reviewed changes

Copilot reviewed 22 out of 26 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
settings.gradle Removes Gradle multi-project settings (Gradle build removal).
release-please-config.json Switches release-please version bumping to update pom.xml via XML XPath.
pom.xml Adds Maven build definition, dependencies, plugins, and signing profile.
mvnw Adds Maven Wrapper (POSIX) script.
mvnw.cmd Adds Maven Wrapper (Windows) script.
.mvn/wrapper/maven-wrapper.properties Configures Maven distribution + wrapper JAR URLs.
.gitignore Updates ignore rules for Maven (and wrapper JAR).
build.gradle Removes root Gradle build definition.
gradle.properties Removes root Gradle build properties.
gradle/dependencies.gradle Removes shared Gradle dependency definitions.
gradle/wrapper/gradle-wrapper.properties Removes Gradle wrapper configuration.
gradlew Removes Gradle wrapper (POSIX) script.
gradlew.bat Removes Gradle wrapper (Windows) script.
java-8/settings.gradle Removes legacy Java 8 Gradle subproject settings.
java-8/gradle.properties Removes legacy Java 8 Gradle subproject properties.
java-8/daemon-jvm.properties Removes legacy Java 8 toolchain properties.
java-8/build.gradle Removes legacy Java 8 Gradle subproject build.
java-8/.gitignore Removes legacy Java 8 subproject ignore file.
android/build.gradle Inlines previously shared dependency declarations into Android Gradle build.
.github/workflows/maven-build.yml Updates CI workflow to build with Maven + new artifact paths.
.github/workflows/codeql-analysis.yml Updates CodeQL build step to Maven.
.github/dependabot.yml Switches root dependency updates to Maven; keeps Gradle updates for Android.
.azure-pipelines/daily-ci-build.yml Updates daily ADO pipeline to Maven task and Maven settings/mirror configuration.
.azure-pipelines/ci-build.yml Updates official ADO pipeline to Maven install/deploy/signing + staging layout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +21
"type": "xml",
"path": "pom.xml",
"xpath": "//project/version"
},
Comment on lines +64 to +67
$props = Get-Content local.properties -Raw
$keyId = ($props | Select-String -Pattern 'signing\.keyId=(.+)').Matches.Groups[1].Value
$keyRingFile = ($props | Select-String -Pattern 'signing\.secretKeyRingFile=(.+)').Matches.Groups[1].Value
$keyPassword = ($props | Select-String -Pattern 'signing\.password=(.+)').Matches.Groups[1].Value
$settingsXml | Set-Content (Join-Path $settingsDir "settings.xml") -Encoding UTF8
displayName: Configure Maven settings

- script: ./mvnw install -Psigning --no-transfer-progress -DmavenCentralSnapshotSuffix=""

- script: ./gradlew --no-daemon publishMavenPublicationToADORepository -PmavenCentralPublishingEnabled=true -PmavenCentralSnapshotArtifactSuffix=""
displayName: Publish to local Maven ADO for ESRP
- script: ./mvnw deploy -Psigning --no-transfer-progress -DmavenCentralSnapshotSuffix="" -DaltDeploymentRepository=ADO::default::file://$(Build.SourcesDirectory)/target/staging-deploy
Comment thread pom.xml

<scm>
<url>https://github.com/microsoftgraph/msgraph-sdk-java</url>
<connection>scm:git:git://github.com/microsoftgraph/msgraph-sdk-java.git</connection>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants